{% extends 'base.html.twig' %}
{% block body_bar %}
    <h5>{{ dry_translation('list') }}</h5>
    <div class="ibox-tools">
        <a class="btn btn-outline btn-info" href="{{ path("group_new") }}" data-route="group_new">{{ dry_translation('new') }}</a>
    </div>
{% endblock %}
{% block body %}
    <table class="table table-striped">
        <thead>
            <tr>
                <th>{{ dry_translation('Group.id') }}</th>
                <th>{{ dry_translation('Group.name') }}</th>
                <th>{{ dry_translation('Group.roles') }}</th>
                <th>{{ dry_translation('action') }}</th>
            </tr>
        </thead>
        <tbody>
            {% for group in groups %}
            <tr>
                <td>{{ group.id }}</td>
                <td>{{ group.name }}</td>
                <td>{{ call_method('choiceShow', rolesArray, group.roles)|nl2br }}</td>
                <td>
                    <div class="btn-group">
                        <a class="btn btn-primary" href="{{ dry_path('group_show', group.id) }}" data-route="group_show">{{ dry_translation('show') }}</a>
                        <a class="btn btn-primary" href="{{ dry_path('group_edit', group.id) }}" data-route="group_edit">{{ dry_translation('edit') }}</a>
                        <a class="btn btn-primary" href="{{ dry_path('group_permission', group.id) }}" data-route="group_permission">{{ dry_translation('groupPermissionAsign') }}</a>
                    </div>
                </td>
            </tr>
            {% endfor %}
        </tbody>
    </table>
{% endblock %}
